/*
 *MIT License
 *
 *Copyright (c) 2019 chenshuai cs4380@163.com
 *
 *Permission is hereby granted, free of charge, to any person obtaining a copy
 *of this software and associated documentation files (the "Software"), to deal
 *in the Software without restriction, including without limitation the rights
 *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 *copies of the Software, and to permit persons to whom the Software is
 *furnished to do so, subject to the following conditions:
 *
 *The above copyright notice and this permission notice shall be included in all
 *copies or substantial portions of the Software.
 *
 *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 *SOFTWARE.
 */

package com.cs.cslc.admin.pojo;

import com.cs.cslc.common.pojo.BasePojo;
import com.cs.cslc.common.validate.AddField;
import com.cs.cslc.common.validate.UpdateField;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.io.Serializable;

/**
 * BaseDept 基础部门信息表.
 *
 * @author cs
 * @version 1.0
 * @date 2019-12-06 09:14
 * @description
 */
@Getter
@Setter
@Table(name = "base_dept")
public class BaseDept extends BasePojo implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @Id
    @NotBlank(groups = UpdateField.class)
    private String id;

    /**
     * 父级部门id
     */
    @NotBlank(groups = UpdateField.class)
    @Column(name = "parent_id")
    private String parentId;

    /**
     * 部门名称
     */
    @NotBlank(groups = {UpdateField.class, AddField.class})
    @Size(min = 1, max = 256)
    @Column(name = "dept_name")
    private String deptName;

    /**
     * 部门编码
     */
    @NotBlank(groups = {UpdateField.class, AddField.class})
    @Size(min = 1, max = 128)
    @Column(name = "dept_code")
    private String deptCode;

    /**
     * 部门说明
     */
    @Column(name = "description")
    private String description;

    /**
     * 是否删除(1:删除|0:未删除)
     */
    @Column(name = "is_deleted")
    private Integer isDeleted;
}